import { getAll, dltStu, addStu, udtStu } from "@/api/server.js"

export default {
    namespaced: true,
    state: {
        serverStu: [],
    },
    mutations: {
        dltStu(state, payload) {
            dltStu(payload)
        },
        addStu(state, payload) {
            addStu(payload)
        },
        udtStu(state, payload) {
            udtStu(payload._id, payload)
        }
    },
    actions: {
        get(state, payload) {
            getAll(payload).then((res) => {
                this.state.server.serverStu = res
            })
        }
    }
}